import { http } from '@/utils/http'
import { Pagination } from '@/models/sys'
import {
  MessageItemModel,
  RoomMessageItemModel,
  UserInfoItemModel,
} from '@/models/roomMessageModels'

/** 群消息回复统计列表 */
export const roomStatList = (params: { page: number; per_page: number }) => {
  return http.get<Pagination<RoomMessageItemModel>>(
    '/library-client/api/wxwork/room-stat/list',
    params,
  )
}

/** 聊天记录 */
export const messagesList = (params: { room_stat_id: number; page: number; per_page: number }) => {
  return http.get<Pagination<MessageItemModel>>(
    '/library-client/api/wxwork/room-stat/messages',
    params,
  )
}

/** 未回复用户列表 */
export const notReplyUsers = (params: { room_stat_id: number; page: number; per_page: number }) => {
  return http.get<Pagination<UserInfoItemModel>>(
    '/library-client/api/wxwork/room-stat/not-reply-users',
    params,
  )
}

/**
 * 已回复用户列表
 * */
export const repliedUsers = (params: { room_stat_id: number; page: number; per_page: number }) => {
  return http.get<Pagination<UserInfoItemModel>>(
    '/library-client/api/wxwork/room-stat/replied-users',
    params,
  )
}

/** 设为已回复
 * status 0=未回复，1=已回复 */
export const setReplied = (params: { room_stat_member_id: number; status: number }) => {
  return http.post('/library-client/api/wxwork/room-stat/set-replied', params)
}
